adb root && adb remount && adb shell setenforce 0
dump_path="/sdcard/xiaoka/vrlog/aud_rec/"
echo "1.软降噪"   
echo "2.硬降噪"
read -p "选择降噪方式:" type;
if [[ $type -eq 1 ]]; then
	dump_path="/mnt/"
	#dump_path="/sdcard/"
fi

adb shell mkdir -p ${dump_path}aw.so_profile
adb shell touch ${dump_path}aw.so_profile/dump_wpe
adb shell touch ${dump_path}aw.so_profile/dump_switch
adb shell touch ${dump_path}aw.so_profile/dump_switch_wakets

if [ -d ${dump_path}aud_rec ]; then
	rm -f ${dump_path}aud_rec
fi
adb shell mkdir -p ${dump_path}aud_rec

if [[ $type -eq 1 ]]; then
adb shell ln -s ${dump_path}aud_rec /data/local/ -f
adb shell ln -s ${dump_path}aw.so_profile /data/local -f
fi


#echo "1.小咖"   
#echo "2.vrDemo"
#read -p "选择测试对象:" number;
#if [[ $number -eq 1 ]]; then
#	adb shell am force-stop com.ecarx.ai.val
#else
#	adb shell am force-stop com.ecarx.ai.val.baidu
#fi
adb shell am force-stop com.ecarx.ai.val
adb shell am force-stop com.ecarx.ai.val.baidu
adb shell am force-stop com.ecarx.ai.baidurecorder
adb shell am force-stop com.baidu.che.codriver

logTempPath=log123.txt 
if [ -f ${logTempPath} ]; then
	rm -rf ${logTempPath}
fi
adb logcat -c && adb logcat  > ${logTempPath} &

echo '语料抓取结束后按任意键'
read -n 1
mkdir aud_rec
adb pull ${dump_path}aud_rec ./aud_rec/
cp ${logTempPath} ./aud_rec/log123456789.txt
rm -rf ${logTempPath}
open .
echo "打开文件夹当前文件夹下的aud_rec即为语料，log123456789.txt为log"